﻿using Microsoft.Practices.Unity;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands.Behaviors.Building;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands.Behaviors.CodeAnalysis;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands.Behaviors.CodeAnalysis.Metrics;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands
{
    [MenuCommand(Constants.Solution.Id, Constants.Solution.CalculateMetrics)]
    public class CalculateSolutionMetricsCommand : CommandBase<CodeAnalysisCommandExecutionContext>
    {
        public CalculateSolutionMetricsCommand(IUnityContainer container)
            : base(container)
        {
            Behaviors.Add(new ValidateMetricsAvailabilityBehavior(container));
            Behaviors.Add(new BuildSolutionBehavior(container));
            Behaviors.Add(new CreateSolutionMetricsCalculatorBehavior(container));
            Behaviors.Add(new PerformCodeAnalysisBehavior(container));
            Behaviors.Add(new ShowCodeMetricsCalculationResultBehavior(container));
        }
    }
}
